import { request } from 'umi';

export async function query() {
  return request<API.CurrentUser[]>('/api/users');
}

export async function queryCurrent() {
  return request<API.LoginStateType>('/api/user/loginUser');
}

export async function queryNotices(): Promise<any> {
  return request<{ data: API.NoticeIconData[] }>('/api/notices');
}

export async function editPassWordAPI(params?: API.EditPassWordParamsType) {
  return request<API.APIReturnType<any>>('/api/user/editPassWord', {
    method: 'post',
    data: params || {},
  });
}
